﻿using Cap.UserMicroservice.Entities;
using Cap.UserMicroservice.Repositorys;
using Cap.UserMicroservice.Services.Dtos;
using Volo.Abp.Application.Services;

namespace Cap.UserMicroservice.Services
{
    public class UserService : CrudAppService<UserInfo, UserInfoDto, Guid>, IUserService
    {
        public IUserRepository repository;

        public UserService(IUserRepository repository):base(repository)
        {
            this.repository = repository;   
        }

        /// <summary>
        /// 获取所有用户
        /// </summary>
        /// <returns></returns>
        public async Task<List<UserInfoDto>> GetUsersAsync()
        {
            List<UserInfo> list = await repository.GetListAsync();
            return ObjectMapper.Map<List<UserInfo>, List<UserInfoDto>>(list);
        }

    }
}
